programming4us
           
 
 
Windows

SOA with .NET and Windows Azure : Web Services (ASMX and WSE)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/13/2010 11:21:57 AM
With .NET, Web services were originally developed using ASP.NET together with IIS. ASP.NET provided an extensive framework built on top of the CLR for developing both Web services and general Web sites.

XML Web Services (ASMX)

Web services were officially referred to as “XML Web Services” and were further termed with the ASMX acronym because, when developed with ASP.NET, their logic was placed into a file with the .asmx extension.

Specifically, this file contained:

  • the ASP.NET @WebService directive

  • code to implement the Web service or a reference to a file that implements the Web service logic (also known as the “code-behind” file)

The typical implementation for a Web service was contained in a code-behind file that is actually referenced using the @WebService directive, as follows:

Example 1.
<%
@WebService
Language="C#"
CodeBehind="~/App_Code/DemoService.cs"
Class="DemoService"
%>

The .NET API used to implement a Web service was contained in the System.Web.Services namespace. Classes and attributes from the namespace used to implement the Web service included:

  • WebService attribute

  • WebMethod attribute

Let’s briefly explain each.

The WebService Attribute

This attribute has to be applied to a class in order to designate it as a Web service, as follows:

Example 2.
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Description = "Demo Service",
Namespace = "http://www.example.org")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
interface IDemoService
{
string Greet();
}
public class DemoService : System.Web.Services.WebService, IDemoService
{
[WebMethod]
public string Greet() {
return "Hello World";
}
}

In this example, the Web service was defined using a .NET interface definition, thereby decoupling the service definition from the service contract (which, incidentally, makes the service easier to manage, reuse, and migrate to WCF).

The WebService attribute accepted three parameters, as shown in Table 1.

Table 1. The parameters for the WebService attribute.
ParameterDescription
Descriptiona brief description of the Web service to help a human user understand its purpose
Namethe name of the Web service (included in the WSDL file and used by service consumers to target the service)
Namespacethe XML namespace for the Web service

The WebMethod Attribute

The WebMethod attribute was used to tag operations in a class that could be exposed by a Web service. For an operation to be available to the service consumer it had to be a public method and further had to be annotated with a WebMethod attribute, as was shown in Example 2.

The WebMethod attribute contained optional parameters that could be used to customize each operation, as listed in Table 2.

Table 2. The parameters for the WebMethod attribute.
ParameterDescription
BufferResponsewhen BufferResponse is set to true, ASP.NET buffers the entire response before sending it to the client—a very efficient, default setting
CacheDurationenables caching the results of a Web service operation (ASP.NET will cache results for a unique set of parameters for the specified duration of time)
Descriptionused to describe an operation for a human user to comprehend the Web method
EnableSessionused to enable session state for a Web method
MessageNameused to uniquely identify overloaded methods using an alias (default value is the name of the method)
TransactionOptionenables a Web method to participate in a transaction (disabled by default)

Web Service Enhancements (WSE)

ASMX primarily supported the creation of Web services based on SOAP and WSDL. It originally did not include support for other WS-* industry standards, most notably WS-Security.

Microsoft subsequently released Web Services Enhancements (WSE) as an extension for the initial ASMX platform. WSE added support for various WS-* standards that introduced new features, such as message-layer security, content-based routing, and support for policies (which corresponded to the WS-Security, WS-Addressing, and WS-Policy standards respectively).

Other -----------------
- Windows 7 : Enhancing Your Browsing Security (part 6) - Managing Add-Ons
- Windows 7 : Enhancing Your Browsing Security (part 5) - Encoding Addresses to Prevent IDN Spoofing
- Windows 7 : Enhancing Your Browsing Security (part 4) - Thwarting Phishers with the SmartScreen Filter
- Windows 7 : Enhancing Your Browsing Security (part 3) - Changing a Zone’s Security Level
- Windows 7 : Enhancing Your Browsing Security (part 2) - Adding and Removing Zone Sites
- Windows 7 : Enhancing Your Browsing Security (part 1) - Blocking Pop-Up Windows
- Windows 7 : Configuring Internet Explorer Security - Enhancing Your Browsing Privacy (part 4) - InPrivate Browsing and Filtering
- Windows 7 : Configuring Internet Explorer Security - Enhancing Your Browsing Privacy (part 3) - Enhancing Online Privacy by Managing Cookies
- Windows 7 : Configuring Internet Explorer Security - Enhancing Your Browsing Privacy (part 2) - Clearing the Address Bar List
- Windows 7 : Configuring Internet Explorer Security - Enhancing Your Browsing Privacy (part 1)
- Windows 7 : Managing Windows Firewall (part 2)
- Windows 7 : Managing Windows Firewall (part 1)
- Windows 7 : Checking Your Computer’s Security Settings (part 2)
- Windows 7 : Checking Your Computer’s Security Settings (part 1)
- Securing Windows 7 : Thwarting Snoops and Crackers (part 2) - Locking Your Computer Manually, Automatically
- Securing Windows 7 : Thwarting Snoops and Crackers (part 1) - First, Some Basic Precautions
- Windows 7 : Working with the Command-Line Tools (part 3) - Working with System Management Tools
- Windows 7 : Working with the Command-Line Tools (part 2) - Working with File and Folder Management Tools
- Windows 7 : Working with the Command-Line Tools (part 1) - Working with Disk Management Tools
- SOA with .NET and Windows Azure : System.Transactions
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us